// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

// 引入eleme-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'



import Vue from 'vue'
import App from './App'
import router from './router'
import config from './lib/config/config.js'
import store from './store'
import axios from  'axios'

Vue.use(config);
// 验证是否授权
router.beforeEach((to, from, next) => {
  let userInfo = window.localStorage.getItem("userInfo");
    if(!userInfo && to.path != "/auth"){
      next("/auth");
      return false;
    }
  next();
});
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$axios = axios
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
